// components/navbar/index.js
const app = getApp()

Component({
  /**
   * 组件的属性列表
   */
  options: {
    styleIsolation: 'shared',
  },
  properties: {
    title: {
      type: String,
      value: '自定义标题'
    },
    backgroundColor: {
      type: String,
      value: '#3D72FF'
    },
    backgroundImage: {
      type: String,
      value: "url('http://www.lzwcl.com/img/navbar-bg.png')"
    },
    textColor: {
      type: String,
      value: '#fff'
    },
    barIconColor: {
      type: String,
      value: '#fff'
    },
    isFixed: {
      type: Boolean,
      value: false
    },
    back: {
      type: Boolean,
      value: true
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    navBarHeight: app.globalData.appInfo.navBarHeight,
  },
  lifetimes: {
    attached: function () {

    },

  },
  /**
   * 组件的方法列表
   */
  methods: {
    onClickLeft() {
      wx.navigateBack({
        delta: 1,
      })
    }
  }
})